package cn.hicard.risk.service.bd.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.hicard.core.Where;
import cn.hicard.core.Page;
import cn.hicard.core.PageResult;
import cn.hicard.risk.dao.bd.CallorderDao;
import cn.hicard.risk.entity.BdCallorder;
import cn.hicard.risk.service.bd.CallorderService;

@Service
public class CallorderServiceImpl implements CallorderService{
	
	private CallorderDao callorderDao;
		
	public void setCallorderDao(CallorderDao callorderDao) {
		this.callorderDao = callorderDao;
	}
	
	public PageResult<BdCallorder> search(Where condition, Page page) throws Exception {		
		return callorderDao.search(condition, page);
	}

	@Override
	public void save(BdCallorder callorder) throws Exception {
		if(callorder.getPicname() == null){
			callorder.setPicname("");
		}
		callorderDao.save(callorder);
	}

	@Override
	public void updateList(List<BdCallorder> list) throws Exception {
		callorderDao.updateList(list);
	}

	@Override
	public boolean existJzg(String orderno) throws Exception {
		return callorderDao.existJzg(orderno);
	}

	@Override
	public boolean existPos(int pkTradefileinfo) throws Exception {
		return callorderDao.existPos(pkTradefileinfo);
	}

	/**
	 * 根据条件查询交易数据集合
	 */
	public List<BdCallorder> findList(BdCallorder start, BdCallorder end)
			throws Exception {		
		return callorderDao.findList(start, end);
	}

	@Override
	public void update(BdCallorder callorder) throws Exception {
		 callorderDao.update(callorder);
	}

}
